<template>
  <div>
    <div
      id="worldvariance"
      style="width: 900px; height: 500px; margin: 30px 300px"
    ></div>
  </div>
</template>

<script>
import echarts from "echarts";
export default {
  methods: {
    drawChart() {
      var myChart = echarts.init(document.getElementById("worldvariance"));
      var option = {
        title: {
          left: "center",
          text: "2020-2021年全球各国确诊人数标准差",
        },
        tooltip: {
          trigger: "axis",
          axisPointer: {
            type: "shadow",
          },
        },
        grid: {
          left: "3%",
          right: "4%",
          bottom: "3%",
          containLabel: true,
        },
        xAxis: [
          {
            type: "category",
            data: [
              "Afghanistan",
              "Albania",
              "Algeria",
              "Andorra",
              "Angola",
              "Antigua and Barbuda",
              "Argentina",
              "Armenia",
              "Australia",
              "Austria",
              "Azerbaijan",
              "Bahamas",
              "Bahrain",
              "Bangladesh",
              "Barbados",
              "Belarus",
              "Belgium",
              "Belize",
              "Benin",
              "Bhutan",
              "Bolivia",
              "Bosnia and Herzegovina",
              "Botswana",
              "Brazil",
              "Brunei",
              "Bulgaria",
              "Burkina Faso",
              "Burma",
              "Burundi",
              "Cabo Verde",
              "Cambodia",
              "Cameroon",
              "Canada",
              "Central African Republic",
              "Chad",
              "Chile",
              "China",
              "Colombia",
              "Comoros",
              "Congo (Brazzaville)",
              "Congo (Kinshasa)",
              "Costa Rica",
              "Cote dIvoire",
              "Croatia",
              "Cuba",
              "Cyprus",
              "Czechia",
              "Denmark",
              "Diamond Princess",
              "Djibouti",
              "Dominica",
              "Dominican Republic",
              "Ecuador",
              "Egypt",
              "El Salvador",
              "Equatorial Guinea",
              "Eritrea",
              "Estonia",
              "Eswatini",
              "Ethiopia",
              "Fiji",
              "Finland",
              "France",
              "Gabon",
              "Gambia",
              "Georgia",
              "Germany",
              "Ghana",
              "Greece",
              "Grenada",
              "Guatemala",
              "Guinea",
              "Guinea-Bissau",
              "Guyana",
              "Haiti",
              "Holy See",
              "Honduras",
              "Hungary",
              "Iceland",
              "India",
              "Indonesia",
              "Iran",
              "Iraq",
              "Ireland",
              "Israel",
              "Italy",
              "Jamaica",
              "Japan",
              "Jordan",
              "Kazakhstan",
              "Kenya",
              "Kiribati",
              "Korea, South",
              "Kosovo",
              "Kuwait",
              "Kyrgyzstan",
              "Laos",
              "Latvia",
              "Lebanon",
              "Lesotho",
              "Liberia",
              "Libya",
              "Liechtenstein",
              "Lithuania",
              "Luxembourg",
              "MS Zaandam",
              "Madagascar",
              "Malawi",
              "Malaysia",
              "Maldives",
              "Mali",
              "Malta",
              "Marshall Islands",
              "Mauritania",
              "Mauritius",
              "Mexico",
              "Micronesia",
              "Moldova",
              "Monaco",
              "Mongolia",
              "Montenegro",
              "Morocco",
              "Mozambique",
              "Namibia",
              "Nepal",
              "Netherlands",
              "New Zealand",
              "Nicaragua",
              "Niger",
              "Nigeria",
              "North Macedonia",
              "Norway",
              "Oman",
              "Pakistan",
              "Palau",
              "Panama",
              "Papua New Guinea",
              "Paraguay",
              "Peru",
              "Philippines",
              "Poland",
              "Portugal",
              "Qatar",
              "Romania",
              "Russia",
              "Rwanda",
              "Saint Kitts and Nevis",
              "Saint Lucia",
              "Saint Vincent and the Grenadines",
              "Samoa",
              "San Marino",
              "Sao Tome and Principe",
              "Saudi Arabia",
              "Senegal",
              "Serbia",
              "Seychelles",
              "Sierra Leone",
              "Singapore",
              "Slovakia",
              "Slovenia",
              "Solomon Islands",
              "Somalia",
              "South Africa",
              "South Sudan",
              "Spain",
              "Sri Lanka",
              "Sudan",
              "Summer Olympics 2020",
              "Suriname",
              "Sweden",
              "Switzerland",
              "Syria",
              "Taiwan*",
              "Tajikistan",
              "Tanzania",
              "Thailand",
              "Timor-Leste",
              "Togo",
              "Tonga",
              "Trinidad and Tobago",
              "Tunisia",
              "Turkey",
              "US",
              "Uganda",
              "Ukraine",
              "United Arab Emirates",
              "United Kingdom",
              "Uruguay",
              "Uzbekistan",
              "Vanuatu",
              "Venezuela",
              "Vietnam",
              "West Bank and Gaza",
              "Yemen",
              "Zambia",
              "Zimbabwe",
            ],
            axisTick: {
              alignWithLabel: true,
            },
          },
        ],
        yAxis: [
          {
            type: "value",
          },
        ],
        dataZoom: [
          {
            startValue: "china",
          },
          {
            type: "inside",
          },
        ],
        series: [
          {
            name: "标准差",
            type: "bar",
            barWidth: "60%",
            data: [
              51863,
              66017,
              69138,
              6074,
              20367,
              1132,
              1964491,
              102006,
              41780,
              307564,
              176265,
              7065,
              102491,
              510774,
              4683,
              195377,
              492065,
              8058,
              7164,
              972,
              181746,
              92798,
              61700,
              7857617,
              3351,
              207305,
              6008,
              157609,
              5894,
              13950,
              40351,
              34123,
              625583,
              3494,
              2003,
              603910,
              16937,
              1845801,
              1794,
              5409,
              19451,
              184495,
              20654,
              171114,
              296709,
              45088,
              748645,
              141297,
              127,
              4249,
              1338,
              133110,
              184948,
              109042,
              36753,
              3819,
              2629,
              67037,
              15078,
              126419,
              18281,
              52020,
              2653417,
              10881,
              3354,
              230253,
              1701683,
              42752,
              248646,
              1658,
              183468,
              10109,
              1842,
              11218,
              7372,
              9,
              125911,
              361403,
              3850,
              12789020,
              1477902,
              1912184,
              695619,
              146123,
              445061,
              1877893,
              29235,
              564163,
              345442,
              319824,
              88284,
              1,
              109654,
              55949,
              147507,
              61239,
              11879,
              70715,
              255731,
              6817,
              1946,
              118722,
              1472,
              140215,
              31298,
              3,
              16307,
              22411,
              768685,
              32329,
              5910,
              14796,
              2,
              11831,
              5273,
              1269199,
              ,
              116546,
              1283,
              110572,
              50589,
              318319,
              53855,
              46875,
              291413,
              798021,
              1637,
              4528,
              2318,
              74778,
              73284,
              68397,
              105955,
              420723,
              2,
              176737,
              9380,
              181697,
              800831,
              852936,
              1267228,
              425861,
              79316,
              528299,
              2703765,
              33489,
              746,
              3950,
              1437,
              1,
              2142,
              1106,
              181513,
              24957,
              373596,
              8276,
              2164,
              44693,
              365448,
              124152,
              9,
              7082,
              986549,
              4623,
              1831178,
              178767,
              14397,
              300,
              14199,
              468323,
              327411,
              13261,
              6575,
              5854,
              6966,
              581110,
              6835,
              8601,
              ,
              18877,
              253443,
              2751702,
              16007245,
              43216,
              1071484,
              277823,
              2871223,
              162114,
              57239,
              2,
              132386,
              280269,
              154475,
              3187,
              78185,
              45841,
            ],
          },
        ],
      };
      myChart.setOption(option);
    },
  },
  mounted() {
    this.drawChart();
  },
};
</script>

<style>
</style>